<template>
  <div class="search-history">
    <IElTable :config="tableConfig" :tableList="collectHistoryList" :column="tableFields" @keyEnter="keyEnterHandler">
      <template #age="{ row }">年龄:{{ row.age }}</template>
      <template #love="{ row }">
        <span @click.stop="() => cancelLoveHandler(row)">
          <svg-icon style="font-size: 16px; padding-right: 6px" icon-class="love-active" v-if="row?.love" />
          <svg-icon style="font-size: 14px; padding-right: 6px" icon-class="love" v-else />
        </span>
      </template>
    </IElTable>
  </div>
</template>

<script>
import SearchTableMixin from './SearchTableMixin.js';
export default {
  name: 'CollectHistory',
  mixins: [SearchTableMixin],
  props: {
    collectHistoryList: {
      type: Array,
      default: () => [],
    },
  },
  methods: {
    // 取消收藏
    cancelLoveHandler(rowItem) {
      this.$emit('cancelLoveHandler', rowItem);
    },
  },
};
</script>
<style lang="scss" scoped>
.search-history {
  padding: 0 10px;
  box-sizing: border-box;
}
</style>
